package com.koushikdutta.ion;

import android.content.Context;
import com.koushikdutta.async.DataEmitter;
import com.koushikdutta.async.future.Future;
import com.koushikdutta.async.future.FutureCallback;
import com.koushikdutta.async.http.AsyncHttpRequest;
import com.koushikdutta.async.http.libcore.RawHeaders;
import com.koushikdutta.ion.bitmap.BitmapInfo;

public interface Loader {

    public static class LoaderEmitter {
        DataEmitter emitter;
        RawHeaders headers;
        long length;
        int loadedFrom;
        AsyncHttpRequest request;

        public LoaderEmitter(DataEmitter emitter, long length, int loadedFrom, RawHeaders headers, AsyncHttpRequest request) {
            this.length = length;
            this.emitter = emitter;
            this.loadedFrom = loadedFrom;
            this.headers = headers;
            this.request = request;
        }

        public DataEmitter getDataEmitter() {
            return this.emitter;
        }

        public long length() {
            return this.length;
        }

        public int loadedFrom() {
            return this.loadedFrom;
        }

        public RawHeaders getHeaders() {
            return this.headers;
        }

        public AsyncHttpRequest getRequest() {
            return this.request;
        }
    }

    Future<DataEmitter> load(Ion ion, AsyncHttpRequest asyncHttpRequest, FutureCallback<LoaderEmitter> futureCallback);

    Future<BitmapInfo> loadBitmap(Context context, Ion ion, String str, String str2, int i, int i2, boolean z);

    Future<AsyncHttpRequest> resolve(Context context, Ion ion, AsyncHttpRequest asyncHttpRequest);
}
